﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ProgNetComponents.Interfaces;
using DevExpress.Utils;
using System.Windows.Forms;
using System.ComponentModel;
using ProgNetComponentsDx.Shortcut.Design;
using System.Drawing.Design;
using ProgNetComponents.Collections;
using System.Drawing;

namespace ProgNetComponentsDx.Shortcut
{
    [TypeConverter(typeof(ShortcutTypeConverter))]
    public class Shortcut : ProgNetComponents.Classes.BaseCustomObject, INamedObject
    {
        internal static Color Color
        {
            get { return Color.Aqua; }
        }
        public Shortcut()
        {
            DefaultShortcut = Keys.None;
        }
        public Shortcut(string name, Keys keys)
        {
            Name = name;
            DefaultShortcut = keys;
        }

        public Shortcut(string name)
            : this(name, Keys.None)
        {

        }
        #region INamedObject Members
        private string _Name;
        public string Name
        {
            get { return _Name; }
            set { _Name = ProgNetComponents.Tools.ConstHelper.GetFriendlyName(value); }
        }

        #endregion

        [Editor(typeof(ShortcutKeyEditor), typeof(UITypeEditor))]
        [TypeConverter(typeof(KeysTypeConverter))]
        public Keys DefaultShortcut
        {
            get;
            set;
        }
    }

    [Editor(typeof(ShortcutCollectionEditor), typeof(UITypeEditor))]
    public class ShortcutCollection : BaseNamedCollection<Shortcut>
    {

    }

    public abstract class ShortcutNames
    {

    }

    [Designer(typeof(ProgNetComponents.Design.Designers.CollectionComponentDesigner))]
    public class ShortcutContainer : Component
    {
        private ShortcutGroupCollection _Items = new ShortcutGroupCollection();

        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        public ShortcutGroupCollection Items
        {
            get { return _Items; }
        }
    }
}
